<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--
  Created by IntelliJ IDEA.
  User: SunKai
  Date: 14-11-11
  Time: 上午11:49
  To change this template use File | Settings | File Templates.
--%>
<html>
<head>
    <link type="text/css" rel="stylesheet" href="/static/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="/static/bootstrap/css/bootstrap-table.css">
    <script type="text/javascript" src="/static/jquery-2.1.0.min.js"></script>
    <script type="text/javascript" src="/static/bootstrap/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="/static/bootstrap/js/bootstrap-table.js"></script>

    <link rel="stylesheet" type="text/css" href="/static/agreement/fontawesome-4.2.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="/static/agreement/css/wangEditor-1.1.0-min.css">
    <title>合同上传</title>
    <script type="text/javascript" src='/static/agreement/js/wangEditor-1.1.0-min.js'></script>
    <script type="text/javascript">
        $(function(){

            var $editor = $("#txtDiv").wangEditor();
            var $textarea = $("#content"),
                    $btnHtml = $("#btnHtml"),
                    $btnHide = $("#btnHide");
            $textarea.hide();
            $btnHtml.click(function(){
                $textarea.val( $editor.html());
            });
            $btnHide.click(function(){
                $textarea.hide();
            });
        });
    </script>
</head>
<body>
<div style="height: 50px;">

</div>
<div style="width: 100%;margin-left: 10px;">
    <table style="width: 100%">
        <tr valign="top">
            <td style="width: 20%">
                <div style="text-align: right">
                    <p>已上传合同：</p>
                    <c:forEach items="${agreementDTOs}" var="agreementDTO">
                        <div>
                            度假屋：${agreementDTO.houseName}&nbsp;&nbsp;<a
                                href="/agreement/showContent/${agreementDTO.guid}">查看详情</a>
                        </div>
                    </c:forEach>
                </div>
            </td>
            <td style="width:  5%"></td>
            <td style="width: 75%">
                <div style="text-align: left;width: 90%">
                    <form:form class="form-horizontal" role="form" commandName="agreement" action=""
                               enctype="multipart/form-data">
                        <div>
                            <div class="col-sm-10">
                                <select id="houseInfoguid" name="houseInfoguid" cssStyle="width: 150px;">
                                    <c:forEach items="${houseInfoDTOs}" var="houseInfoDTO">
                                        <option value="${houseInfoDTO.guid}" >${houseInfoDTO.name}</option>
                                    </c:forEach>
                                </select>
                            </div>
                            <br/>
                            <br/>

                            <div id="txtDiv" style="border:1px solid #cccccc; height:400px;width: 850px;">
                                <p></p>
                            </div>
                            <div style="margin-top:10px;">
                                <textarea id="content" name="content" style="width:100%; height:100px; margin-top:10px;"></textarea>
                            </div>
                            <br/>
                            <br/>
                            <input type="submit" value="确认上传" id="btnHtml">
                        </div>
                    </form:form>
                </div>
            </td>
        </tr>
    </table>
</div>
</body>
</html>
